package com.example.invoke.redission;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;

import java.io.IOException;

@Configuration
public class RedissionConfig {

    @Bean
    public RedissonClient initRedission() throws IOException {
        return Redisson.create(
                Config.fromYAML(new ClassPathResource("redission-sigle.yml").getInputStream())
        );
    }
}
